/**
 * Program   :   ISecurityService.java
 * Author    :   shadow guo
 * Create    :   2013-6-9 上午11:28:36
 *
 * Copyright 2008 by Tongfu Information Technology Co. Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Tongfu Information Technology Co. Ltd. ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Tongfu Information Technology Co. Ltd.
 * 
 */
package com.tongfusoft.web.core.service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.springframework.security.core.GrantedAuthority;

import com.tongfusoft.web.core.data.PrivilegeData;
import com.tongfusoft.web.core.data.ResourceData;
import com.tongfusoft.web.core.data.User;

public interface ISecurityService {
	/**
	 * 根据用户名返回用户权限列表
	 * @param userName
	 * @return
	 */
	public Collection<GrantedAuthority> loadUserAuthoritiesByName(String userName);
	
	/**
	 * 根据用户名获取用户密码
	 * @param userName
	 * @return
	 */
	public String getPwdByName(String userName);
	
	/**
	 * 根据用户名返回用户信息
	 * @param userName
	 * @return
	 */
	public User getUserInfo(String userName);
	
	/**
	 * 返回所有的权限
	 * @return
	 */
	//select authority_name from pub_authorities
	public List<PrivilegeData> getAllPrivilege();
	
	/**
	 * 根据权限返回权限所有资源
	 * @param privilege
	 * @return
	 */
	public List<ResourceData> getResroucesByPrivilege(PrivilegeData privilege);
	
	/**
	 * 用户验证
	 * @param params
	 * @return
	 */
	public boolean validateUser(Map params);
	
	/**
	 * 获取相关需要设置到session中值
	 * @param user
	 * @param params
	 * @return
	 */
	public Map<String,Object> getPredefineContent(User user,Map params);
}
